# coding=utf-8
#================================================================
#   Copyright (C) 2020 * Ltd. All rights reserved.
#
#   File name   : client.py
#   Author      : ZouZheKang-1996
#   Created date: 2020-08-14 18:38:41
#   Description : XuQingQing,I really ❤ U！
#
#================================================================

import requests
import argparse

REST_API_URL = 'http://172.16.1.167:5000/predict'

def predict_result(image_path):

    image = open(image_path, 'rb').read()
    payload = {'image': image}

    r = requests.post(REST_API_URL, files=payload).json()

    if r['success']:
        print(r['predictions'])
    else:
        print('Request failed')

predict_result("./qq.jpg")